package fpzhan.plane.program.connect;

import fpzhan.plane.program.exception.ExecuteParamToolException;
import fpzhan.plane.program.function.CodeBlockFunction;
import fpzhan.plane.program.param.ExecuteParamTool;
import fpzhan.plane.program.param.ParamTool;

import java.util.HashSet;
import java.util.Set;
import java.util.function.Supplier;

public abstract class AddParamTool<T> extends ParamTool<T> {

    private Set<String> adds;

    public AddParamTool(String getKey, Supplier<T> supplier) throws ExecuteParamToolException {
        super(getKey, supplier);
    }

    public AddParamTool(String getKey, ParamTool<T>.Operate operate, Set<String> adds) {
        super(getKey, operate);
        this.adds = adds;
    }

    public abstract ExecuteParamTool<T> add(String saveKey);

    public Set<String> getAdds(){
        return adds;
    }

    protected void initAdds(){
        adds=new HashSet<>();
    }

    @Override
    abstract protected CodeBlockFunction end();


}
